#include <QtGui/QApplication>
#include <QtGui/QPushButton>
#include <QTextCodec>
#include <QObject>
#include <QVBoxLayout>
#include <QHBoxLayout>

int main(int argc, char **argv)
{
	QApplication a(argc, argv);
	
	QTextCodec *textcodec = QTextCodec::codecForName("utf-8");//设置字符编码

	QTextCodec::setCodecForCStrings(textcodec);
	QTextCodec::setCodecForLocale(textcodec);
	QTextCodec::setCodecForTr(textcodec);

	QPushButton btnHello("按钮一", 0);
	QPushButton btnHello2("按钮", 0);
	QPushButton btnHello3("按钮", 0);

    btnHello.resize(100, 200);
	btnHello.setFont(QFont("宋体", 18, QFont::Bold));
	QObject::connect(&btnHello, SIGNAL(clicked()), &a, SLOT(quit()));
	//btnHello.show();
	//QLabel lblHello("hello");
	//lblHello.show();

	QWidget *window = new QWidget;
	QHBoxLayout *layout = new QHBoxLayout;
	layout->addWidget(&btnHello);
	layout->addWidget(&btnHello2);
	layout->addWidget(&btnHello3);
	window->setLayout(layout);
	window->show();
	return a.exec();
}
